<template>
  <CompOperate
      :field="field"
      :designer="designer"
      :design-state="designState"
      :parent-list="parentList"
      :parent-widget="parentWidget"
      :sub-form-row-id="subFormRowId"
      :sub-form-row-index="subFormRowIndex"
      :sub-form-col-index="subFormColIndex"
      :index-of-parent-list="indexOfParentList"
      :display-style="field['options'].displayStyle"
  >
    <div class="scene-DRC-double-info-widget" :style="getStyle('head')">
      <div class="widget-inside">
        <!--科室信息-->
        <div class="dept-room" :class="getDeptClassName" v-if="(optionsInfo.deptShown)||(optionsInfo.roomShown)">
          <p class="dept" v-if="(optionsInfo.deptShown)&&false">{{ getRoomDeptInfo.deptName || '\u00a0' }}</p>
          <p class="room" v-if="(optionsInfo.roomShown)&&false">
            {{ getRoomDeptInfo[optionsInfo['roomNameKey']] || getRoomDeptInfo.roomName || '\u00a0' }}
          </p>
          <p class="room-merge">
            <ScrollX>{{ getDeptRoomInfo }}</ScrollX>
          </p>
        </div>

        <!--医生排班业务-->
        <div class="doc-scheduling-info">
          <template v-for="(item,index) in getRoomDoctorInfo">
            <div class="doctor-describe">
              <div class="left">
                <img :src="getDoctorPicture(item)" alt="医生">
              </div>
              <div class="right">
                <!--医生相关信息-->
                <div class="doc-desc-info">
                  <div class="title">
                    <div class="name" :style="getStyle('doctorName')">
                      <ScrollX>{{ item['workerName'] || '\u00a0' }}</ScrollX>
                    </div>
                    <div class="academic—title">
                      <ScrollX>{{ item['workerTitle'] || '\u00a0' }}</ScrollX>
                    </div>
                  </div>
                  <div class="desc">
                    <ScrollY :content="item['workerIntro'] || '\u00a0'" :pageDuration="10"/>
                  </div>
                </div>
                <!--排版的界面-->
                <div class="scheduling">
                  <div class="scheduling-inside">
                    <div class="header">
                      <div class="item" v-for="(item, index) in getScheduleCleaning(item['scheduleList'])" :key="index">
                        {{ item.label }}
                      </div>
                    </div>
                    <div class="content">
                      <div class="item" v-for="(item, index) in getScheduleCleaning(item['scheduleList'])" :key="index">
                        <template v-if="index === 0">
                          {{ item.status }}
                        </template>
                        <template v-else>
                          {{item.info}}
                        </template>
                      </div>
                    </div>
                  </div>
                  <div class="scheduling-describe">
                    *普通号医生本周排班为临时排班，实际以挂号信息为准
                  </div>
                </div>
              </div>
            </div>
            <!--患者信息-->
            <div class="patient-info">
              <div class="item current-patient flex-box" :class="getPatientClassName('current-patient')">
                <div class="title flex-box-left">{{ optionsInfo['currentPatientContent'] || '就诊' }}</div>
                <div class="content flex-box-right" :class="{'current-patient-info': scrollInfo(item)}">
                  <div class="scroll-info" v-if="scrollInfo(item)">
                    <vue-seamless-scroll
                        class="scroll"
                        :class="{'scroll-hide-waiting': optionsInfo.waitingPatientHide}"
                        :ref="`scroll-${item.workerId}`"
                        @ScrollEnd="(e)=>handleScrollEnd(e, item)"
                        :class-option="scrollOptionInfo2"
                        :data="(item.treatingPatient)"
                    >
                      <template v-for="PatientItem in (item.treatingPatient)">
                        <p class="item">
                          {{ (PatientItem.orderNo) || '&nbsp;' }}
                          {{ (PatientItem.patientName) || '&nbsp;' }}
                        </p>
                      </template>
                    </vue-seamless-scroll>
                  </div>
                  <p v-else>
                    <template v-for="PatientItem in (item.treatingPatient)">
                      {{ (PatientItem.orderNo) || '&nbsp;' }}
                      {{ (PatientItem.patientName) || '&nbsp;' }}
                    </template>
                  </p>
                </div>
              </div>
              <div class="item wait-patient flex-box" :class="getPatientClassName('wait-patient')">
                <div class="title flex-box-left">{{ optionsInfo['waitingPatientContent'] || '候诊' }}</div>
                <template v-if="waitPatientTypeInfo ===1">
                  <div class="content flex-box-right" :class="`waiting-patient-${optionsInfo['waitMode']}`">
                    <template v-for="(item2) in getWaitingPatientList(item.waitingPatientList)">
                      <p class="patient-item">
                        {{ item2.orderNo || '&nbsp;' }} {{ item2.patientName || '&nbsp;' }}
                      </p>
                    </template>
                  </div>
                </template>
                <template v-else-if="waitPatientTypeInfo ===2">
                  <div class="content flex-box-right scroll-area"
                       :class="{'scroll-area-all': getWaitingPatientList(item.waitingPatientList).length>6 }">
                    <template
                        v-if="(optionsInfo.openScroll)&&(optionsInfo.waitPatientNumber)>(optionsInfo.waitPatientScrollNumber)">
                      <vue-seamless-scroll
                          class="scroll"
                          :ref="`scroll-${item.workerId}`"
                          @ScrollEnd="(e)=>handleScrollEnd(e, item)"
                          :class-option="optionScroll"
                          :data="getWaitingPatientList(item.waitingPatientList)"
                      >
                        <div class="inside-content" :class="getWaitPatientNumber((item.waitingPatientList), true)">
                          <div class="patient"
                               v-for="(item2,index) in getWaitingPatientList(item.waitingPatientList)"
                               :key="`${(item2.queuingId) || index}-${(item2.patientIdNo) || index}`"
                          >
                            <span class="patient-orderNo" v-if="!!(item2.orderNo)">
                              {{ item2.orderNo }}
                            </span>
                            <template>
                              {{ item2.patientName || '' }}
                            </template>
                          </div>
                        </div>
                      </vue-seamless-scroll>
                    </template>
                    <template v-else>
                      <div class="no-scroll-area" :class="getWaitPatientNumber((item.waitingPatientList), false)">
                        <p v-for="(item2,index) in getWaitingPatientList(item.waitingPatientList)"
                           :key="`${item2.patientIdNo}-${index}`">
                          {{ item2.orderNo || '&nbsp;' }} {{ item2.patientName || '&nbsp;' }}
                        </p>
                      </div>
                    </template>
                  </div>
                </template>
              </div>
            </div>
          </template>
          <div class="pass-patient-area">
            <div class="title">过号</div>

            <vue-seamless-scroll
                ref="scroll"
                class="scroll"
                :key="widgetKey"
                :class-option="scrollOptionInfo"
                :data="passPatientInfos"
            >
              <div class="content pass-patient">
                <template v-for="passItem in passPatientInfos">
                  <div>{{ passItem['orderNo'] || '\u00a0' }} {{ passItem['patientName'] || '\u00a0' }}</div>
                </template>
              </div>
            </vue-seamless-scroll>
          </div>
        </div>

        <!--二维码业务-->
        <div class="code-area">
          <div class="nav item">
            <div class="picture">
              <img :src="require(`@/components/assets/images/design/nav.png`)">
            </div>
            <div class="describe">医院导航</div>
          </div>
          <div class="public item">
            <div class="picture">
              <img :src="require(`@/components/assets/images/design/public.png`)">
            </div>
            <div class="describe">健康淄博公众号</div>
          </div>
          <div class="Internet item">
            <div class="picture">
              <img :src="require(`@/components/assets/images/design/Internet.png`)">
            </div>
            <div class="describe">互联网医院</div>
          </div>
        </div>


      </div>
    </div>
  </CompOperate>
</template>

<script>
import {pxToVw} from '@/utils/common';
import emitter from "@/utils/designer/emitter";
import {buildParentApi} from "@/utils/designer/util";
import mixin from "@sc/templateDetails/modules/homeMiddle/fieldMixin";
import CompOperate from "@c/public/form-designer/devType/modules/compOperate.vue";
import ScrollY from "@c/public/seamlessScroll/ScrollY.vue";
import ScrollX from "@c/public/seamlessScroll/ScrollX.vue";
import vueSeamlessScroll from 'vue-seamless-scroll';
import {v4 as uuid} from "uuid";

let buildParent = buildParentApi();

export default {
  name: "scene-DRC-scheduling-info-widget",

  componentName: "FieldWidget", //必须固定为FieldWidget，用于接收父级组件的broadcast事件

  mixins: [emitter, mixin],

  components: {
    ScrollX,
    ScrollY,
    vueSeamlessScroll,
    CompOperate,
  },

  props: {
    widget: Object,
    field: Object,
    parentWidget: Object,
    parentList: Array,
    indexOfParentList: Number,
    designer: Object,
    designState: {
      type: Boolean,
      default: false,
    },
    devType: {
      type: Boolean,
      default: false,
    },
    subFormRowIndex: {
      /* 子表单组件行索引，从0开始计数 */ type: Number,
      default: -1,
    },
    subFormColIndex: {
      /* 子表单组件列索引，从0开始计数 */ type: Number,
      default: -1,
    },
    subFormRowId: {
      /* 子表单组件行Id，唯一id且不可变 */ type: String,
      default: "",
    },
    headTitle: {
      type: String,
      default: "",
    },
    visibleTitle: {
      type: Boolean,
    },
    //prop传入的表单JSON配置
    parentApi: {
      type: Object,
      default: () => buildParentApi()
    },
  },

  data() {
    return {
      widgetKey: uuid(),
      optionsInfo: Object(),
      header: require("@a/images/design/header.jpeg"),
      pause: require("@a/images/design/pause.png"),
      weekInfo: [
        {label: '排班', value: 0, status: '午别'},
        {label: '周一', value: 1, status: false},
        {label: '周二', value: 2, status: false},
        {label: '周三', value: 3, status: false},
        {label: '周四', value: 4, status: false},
        {label: '周五', value: 5, status: false},
        {label: '周六', value: 6, status: false},
        {label: '周日', value: 7, status: false}
      ],
    }
  },

  computed: {
    // 温馨提示的滚动
    scrollOptionInfo() {
      return {
        step: [0.8, 1, 1.5, 2, 2.5, 3][0], // 数值越大速度滚动越快
        hoverStop: true,
        limitMoveNum: 6, // 开始无缝滚动的数据量 this.dataList.length
        direction: 1 // 0向下 1向上 2向左 3向右
      };
    },

    scrollOptionInfo2(){

    },


    // 候诊列表等待--滚动设置
    optionScroll() {
      let {openScroll = false, waitPatientScrollNumber = 2, waitPatientStep = 1} = (this.optionsInfo)
      return {
        hoverStop: true,
        direction: 1,                               // 0向下 1向上 2向左 3向右
        isSingleRemUnit: true,
        step: [1, 1.5, 2, 2.5, 3][waitPatientStep - 1], // 数值越大速度滚动越快
        limitMoveNum: openScroll ? waitPatientScrollNumber : 999999, // 开始无缝滚动的数据量 this.dataList.length
      };
    },

    // 设置的行内样式
    getStyle() {
      return function (val) {
        const self = this;
        let info = (self.optionsInfo) || Array();
        let Obj = Object();
        switch (val) {
          case 'head':
            Reflect.set(Obj, 'height', pxToVw(info.headHeight));
            Reflect.set(Obj, 'backgroundColor', `${(info.backgroundColor)}`);
            return Obj;
          case 'picture':
            Reflect.set(Obj, 'height', pxToVw(info.imageHeight));
            Reflect.set(Obj, 'width', pxToVw(info.imageWidth));
            Reflect.set(Obj, 'borderRadius', pxToVw(info.imageRadius));
            return Obj;
          case 'doctorName':
            Reflect.set(Obj, 'fontWeight', (info.doctorFontWeight) || 'normal');
            return Obj;
        }
      }
    },

    //获取科室诊室信息
    getDeptRoomInfo() {
      const roomDeptInfo = (this.getRoomDeptInfo);
      let {deptShown=true, roomNameKey='roomName'} = (this.optionsInfo);
      let content = roomDeptInfo[roomNameKey] || roomDeptInfo['roomName'];
      if (deptShown) {
        let temp = `${roomDeptInfo[roomNameKey] || roomDeptInfo['roomName'] || '\u00a0'}`
        if (!!this.$lodash.trim(temp)) {
          content = `${roomDeptInfo['deptName'] || '\u00a0'}「${roomDeptInfo[roomNameKey] || roomDeptInfo['roomName'] || '\u00a0'}」`
        } else {
          content = `${roomDeptInfo['deptName'] || '\u00a0'}`
        }
      }
      return content
    },

    // 科室隐藏
    getDeptClassName() {
      let {deptShown} = (this.optionsInfo);
      if (!deptShown) {
        return 'dept-room-hide'
      }
    },

    // 设置不同模式下的样式
    getPatientClassName() {
      let waitMode = (this.optionsInfo)
      return function (type) {
        if (type === 'wait-patient') {
          switch (waitMode) {
            case 1:
              return 'current-patient'
            case 2:
              return 'current-patient2'
            case 3:
              return 'current-patient3'
          }
        } else if (type === 'wait-patient') {
          switch (waitMode) {
            case 1:
              return 'wait-patient'
            case 2:
              return 'wait-patient2'
            case 3:
              return 'wait-patient3'
          }
        }
      }
    },

    getDoctorClassName() {
      let {deptHide, roomHide} = (this.optionsInfo);
      if (deptHide && roomHide) {
        return 'doctor-info-2'
      } else if (deptHide || roomHide) {
        return 'doctor-info-1'
      } else {
        return 'doctor-info'
      }
    },

    // 获取科室信息
    getRoomDeptInfo() {
      let devType = (this.devType);
      let roomDoctorInfo = this.$store.getters['getRoomDeptInfo'];
      if (devType) {
        return roomDoctorInfo.apiData;
      } else {
        return roomDoctorInfo.mockData;
      }
    },

    // 获取全量医患信息
    getRoomDoctorInfo() {
      let temp = Array();
      let devType = (this.devType);
      let listInfo = Array();
      let roomDoctorInfo = this.$store.getters['getRoomDoctorInfo'];
      if (devType) {
        listInfo = roomDoctorInfo.apiData
      } else {
        listInfo = roomDoctorInfo.mockData
      }
      if (!!(listInfo?.length)) {
        if ((listInfo.length) >= 1) {
          return listInfo.slice(0, 1);
        } else {
          let arr = (new Array(1 - listInfo.length).fill({}));
          return [...listInfo, ...arr];
        }
      } else {
        return temp.push({});
      }
    },

    // 获取医生头像
    getDoctorPicture() {
      return function (row) {
        let isPause = (row?.isPause);
        let header = '/tpleditor/resource/assets/images/header.png';
        if (!isPause) {
          return (row.workerPicture) || header
        } else {
          return this.pause;
        }
      }
    },

    // 获取等待就诊的医生列表信息
    waitPatientsList() {
      return function (val) {
        let waitingPatient = val.waitingPatientList;
        if (Array.isArray(waitingPatient)) {
          let waitNum = this.optionsInfo.waitMode || 1;
          switch (waitNum) {
            case 1:
            case 2:
              return waitingPatient.slice(0, waitNum);
            default:
              return waitingPatient.slice(0, 1);
          }
        } else {
          return [];
        }
      };
    },


    // 过号患者信息
    passPatientInfos() {
      let devType = (this.devType);
      let WaitingPatientList = this.$store.getters['getPassPatientInfo'];
      if (devType) {
        return WaitingPatientList.apiData;
      } else {
        return WaitingPatientList.mockData;
      }
    },

    // 判断当前患者是否滚动
    scrollInfo() {
      return function (info) {
        return !!(info.treatingPatient) && (info.treatingPatient.length) > 1
      }
    },

    // 判断候诊模式
    waitPatientTypeInfo() {
      let {waitPatientType = 1} = this.optionsInfo;
      return waitPatientType
    },

    // 候诊患者截取
    getWaitingPatientList() {
      return function (row) {
        let {waitPatientType = 1} = (this.optionsInfo);
        switch (waitPatientType) {
          case 1:
            if (!!row && !!(row.length)) {
              let {waitMode} = (this.optionsInfo);
              return row.slice(0, waitMode)
            } else {
              return [];
            }
          case 2:
            if (!!row && !!(row.length)) {
              let {waitPatientNumber} = (this.optionsInfo);
              return row.slice(0, waitPatientNumber)
            } else {
              return [];
            }
        }
      }
    },

    // 候诊等待
    getWaitPatientNumber() {
      return function (row, scroll) {
        let waitingPatientList = this.getWaitingPatientList(row);
        if (scroll) {
          if (Array.isArray(waitingPatientList)) {
            return `scroll-area-${waitingPatientList.length}`
          } else {
            return `scroll-area`
          }
        } else {
          if (Array.isArray(waitingPatientList)) {
            if (waitingPatientList.length >= 6) {
              return `no-scroll-area-6`
            } else {
              return `no-scroll-area-${waitingPatientList.length}`
            }

          } else {
            return `no-scroll-area`
          }
        }
      }
    },

    // 排班数据清洗
    getScheduleCleaning() {
      return function (row) {
        if(row?.length){
          // 按照周期分类
          const groupByGender = row.reduce((result, item) => {
            const key = item.week;
            if (!result[key]) {
              result[`${key}`] = [];
            }
            result[key].push(item);
            return result;
          }, {});
          // 向排班对象中添加信息
          let weekInfos = [...this.weekInfo];
          weekInfos.forEach((item, index) => {
            let i = Reflect.has(groupByGender, item.value);
            if (i) {
              let current = Reflect.get(groupByGender, item.value);
              if (!!current && !!current.length) {
                let hasAllDay = current[0].hasAllDaySchedule;
                if (parseInt(hasAllDay) === 1) {
                  Reflect.set(this.weekInfo[index + 1], 'info', '全天');
                } else {
                  console.log('------')
                  let numberList = current[0].noonVOList;
                  let infos = '';
                  numberList.forEach((item) => {
                    if (!!infos) {
                      infos = `${infos}-${item.noonName}`;
                    } else {
                      infos = `${item.noonName}`;
                    }
                  });
                  Reflect.set(this.weekInfo[index + 1], 'info', infos);
                }
              } else {
                Reflect.set(item, 'info', '');
              }
            } else {
              if (!!this.weekInfo[index + 1]) {
                Reflect.set(this.weekInfo[index + 1], 'info', '');
              }
            }
          });
          return weekInfos
        }else {
          return Array();
        }
      }
    }

  },

  created() {
    this.registerToRefList();
    this.initEventHandler();
    this.handleOnCreated();
  },

  mounted() {
    this.handleOnMounted();
  },

  methods: {
    // 接收父组件传递过来的数据
    executeMethod(key, data) {
      switch (key) {
        case "roomDeptInfo":
          console.log(`科室信息-${data}`)
          this.states = true;
          //buildParent.executeParentMethod('writeLog', JSON.stringify({sign: '模板-科室信息', key: key, data: data}))
          this.$store.dispatch('setRoomDeptInfo', data)
          break
        case "roomDoctorInfo":
          console.log(`全量医患信息-${data}`)
          this.states = true;
          // this.parentApi.executeParentMethod('writeLog', JSON.stringify({sign:'模板日志-医生信息',key:key,data:data}));
          this.$store.dispatch('setRoomDoctorInfo', this.$lodash.cloneDeep(data))
          break
        case "passPatientInfo":
          // console.log(`过号-数据处理逻辑-${data}`)
          this.widgetKey = uuid();
          this.$store.dispatch('setPassPatientInfo', this.$lodash.cloneDeep(data))
          break
      }
    },
    // 滚动结束
    handleScrollEnd() {
    },
  },

  watch: {
    field: {
      handler: function (val) {
        let key = (val.options.config)
        this.optionsInfo = val.options[key];
      },
      deep: true,
      immediate: true
    }
  },

  destroyed() {
    this.unregisterFromRefList();
  },
};
</script>

<style lang="scss" scoped>
.scene-DRC-double-info-widget {
  padding: 28px 30px;
  box-sizing: border-box;
  flex: inherit;
  flex-direction: column;
  justify-content: space-between;
  color: #333;
  height: 150px;
  font-size: 40px;
  background: transparent;
  overflow: hidden;

  .widget-inside {
    height: calc(100%);
    border-radius: 42px 42px 16px 16px;
    overflow: hidden;

    //科室
    .dept-room {
      padding: 20px 0 8px 0;
      background: rgba(0, 139, 142, 1);
      height: 200px;
      overflow: hidden;

      p {
        color: #FFFFFF;
        text-align: center;
        font-size: 80px;
        padding: 0 30px;
      }

      .dept {
        font-size: 80px;
        line-height: 120px;
        @include singleEllipsis(100%)
      }

      .room {
        font-size: 120px;
        font-weight: normal;
        line-height: 180px;
      }

      .room-merge {
        font-size: 120px;
        font-weight: normal;
        line-height: 180px;
      }
    }

    //科室隐藏
    .dept-room-hide {
      display: flex;

      p {
        width: 100%;
        align-self: center;
      }
    }

    .doc-scheduling-info {
      font-size: 42px;
      display: flex;
      flex-direction: column;
      margin-top: 24px;

      .doctor-describe {
        display: flex;
        //图片视图
        .left {
          width: 320px;
          height: 406px;
          overflow: hidden;
          margin-right: 18px;
          box-sizing: border-box;
          display: flex;
          flex-shrink: 0;
          border-radius: 16px;
          border: 1px #cccccc solid;

          img {
            width: 100%;
            height: 100%;
            object-fit: cover;
          }
        }

        //文字视图
        .right {
          width: calc(100% - 320px);
          display: flex;
          flex-direction: column;

          .doc-desc-info {
            display: flex;
            overflow: hidden;
            min-height: 220px;

            .title {
              width: 250px;
              display: flex;
              justify-content: center;
              flex-direction: column;
              align-self: start;
              margin-right: 14px;
              box-sizing: border-box;

              .name {
                font-size: 72px;
                line-height: 108px;
              }

              .academic—title {
                font-size: 40px;
                line-height: 60px;
                text-align: left;
              }
            }

            .desc {
              font-size: 32px;
              height: 200px;
              width: calc(100% - 266px);
              overflow: hidden;
              text-overflow: ellipsis;
              display: -webkit-box;
              -webkit-line-clamp: 5;
              color: rgba(153, 153, 153, 1);
              line-height: 48px;
              -webkit-box-orient: vertical;
            }
          }

          .scheduling {
            width: 100%;
            margin-top: 30px;
            align-items: end;
            align-self: flex-end;

            .scheduling-inside {
              width: 100%;

              .header {
                display: flex;
                height: 46px;
                line-height: 46px;
                padding: 0;

                .item {
                  flex: 1;
                  font-size: 18px;
                  text-align: center;
                  justify-content: center;
                  border: 1px #babbbd solid;
                  border-radius: 8px 8px 0 0;
                }
              }

              .content {
                display: flex;
                height: 46px;
                line-height: 46px;

                .item {
                  flex: 1;
                  font-size: 18px;
                  background: white;
                  text-align: center;
                  justify-content: center;
                  border: 1px #babbbd solid;
                  border-radius: 0 0 8px 8px;

                  &:first-child {
                    background: #f4f4f4;
                  }
                }
              }
            }

            .scheduling-describe {
              font-weight: 400;
              font-size: 28px;
              color: #F05050;
              line-height: 40px;
              text-align: justify;
              font-style: normal;
              margin-top: 20px;
              @include singleEllipsis(100%)
            }
          }
        }
      }

      //患者信息
      .patient-info {
        margin-top: 40px;

        .item {
          display: flex;
          overflow: hidden;
          border-radius: 20px;

          .title {
            color: white;
            align-items: center;
            align-self: center;
            text-align: center;
            height: 100%;
            line-height: 1.15;
            padding: 0 30px;
            flex: inherit;
            display: flex;
            width: 124px !important;
            font-size: 52px;
          }

          .content {
            display: flex;
            flex-direction: column;
            align-self: center;
            align-items: center;
            justify-content: left;
            background: transparent;
            border: none;
            overflow: hidden;
            width: calc(100% - 124px) !important;

            p {
              font-size: 96px;
              width: 100%;
              line-height: 176px;
              text-align: left;
              padding-left: 60px;
            }


            :deep(.scroll) {
              width: 100%;
              min-height: 320px;
              overflow: hidden;

              .inside-content {
                height: 100%;
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                align-self: center;
                align-items: center;
                overflow: hidden;

                .patient {
                  height: auto;
                  flex-basis: 50%;
                  min-width: 50%;
                  box-sizing: border-box;
                  overflow: hidden;
                  font-size: 76px;
                  line-height: 116px;
                  text-align: left;
                  padding-left: 30px;
                  color: rgba(229, 134, 2, 1);

                  .patient-orderNo {
                    padding-right: 4px;
                  }
                }
              }

              .scroll-area-1-1 {
                display: flex;
                width: 100%;
                height: 100%;
                flex-wrap: wrap;
                align-self: center;
                align-items: center;
                flex-direction: column;

                .patient {
                  flex-basis: 100%;
                  min-width: 100%;
                  font-size: 120px;
                  text-align: center;
                  box-sizing: border-box;
                  padding-left: 60px;
                  line-height: 188px !important;
                }
              }

              .scroll-area-2-2 {
                display: flex;
                width: 100%;
                height: 100%;
                flex-wrap: wrap;
                align-self: center;
                align-items: center;
                flex-direction: column;

                .patient {
                  flex-basis: 100%;
                  min-width: 100%;
                  font-size: 100px;
                  text-align: center;
                  box-sizing: border-box;
                  line-height: 148px !important;
                }
              }
            }

            :deep(.scroll-hide-waiting) {
              height: 470px;

              .item {
                width: 100%;
                display: flex;
                padding-left: 60px;
                text-align: center;
              }
            }

            .no-scroll-area-1 {
              display: flex;
              width: 100%;
              flex-wrap: wrap;
              flex-direction: column;

              p {
                flex-basis: 100%;
                min-width: 100%;
                font-size: 120px;
                text-align: left;
                box-sizing: border-box;
                padding-left: 60px;
                line-height: 188px !important;
              }
            }

            .no-scroll-area-2 {
              display: flex;
              flex-wrap: wrap;
              flex-direction: column;
              width: 100%;

              p {
                flex-basis: 100%;
                min-width: 100%;
                font-size: 90px;
                text-align: left;
                box-sizing: border-box;
                padding-left: 60px;
                line-height: 148px !important;
              }
            }

            .no-scroll-area-3,
            .no-scroll-area-4 {
              display: flex;
              flex-wrap: wrap;

              p {
                flex-basis: 50%;
                min-width: 50%;
                font-size: 76px;
                text-align: left;
                box-sizing: border-box;
                padding-left: 30px;
                line-height: 128px !important;
              }
            }

            .no-scroll-area-5,
            .no-scroll-area-6 {
              display: flex;
              flex-wrap: wrap;

              p {
                flex-basis: 50%;
                min-width: 50%;
                font-size: 70px;
                text-align: left;
                box-sizing: border-box;
                padding-left: 30px;
                line-height: 108px !important;
              }
            }

          }

          .current-patient-info {
            height: 100%;
            display: flex;
            align-self: center;
            align-items: center;

            .scroll-info {
              width: 100%;
              overflow: hidden;
              margin-top: 10px;
              height: calc(100% - 40px);
              box-sizing: border-box;

              p {
                height: 100%;
                width: 100%;
                display: flex;
                font-size: 90px;
                line-height: 150px;
                align-items: flex-start;
                white-space: nowrap;
              }
            }
          }

          .scroll-area-all {
            align-items: start;
            align-self: auto;
          }
        }

        .current-patient {
          height: 160px;
          min-height: inherit;
          background: rgba(0, 139, 142, 0.2);

          .title {
            font-size: 48px;
            background: rgba(0, 139, 142, 1);
          }

          p {
            color: rgba(0, 139, 142, 1);
          }
        }

        .current-patient2 {
          height: 160px;
          min-height: inherit;
          min-width: auto;

          .title {
            font-size: 52px;
          }
        }

        .wait-patient {
          height: 160px;
          min-height: inherit;
          margin-top: 44px;
          margin-bottom: 44px;
          min-width: auto;
          box-sizing: border-box;
          background: rgba(229, 134, 2, 0.2);

          .title {
            background: rgba(229, 134, 2, 1);
          }

          .waiting-patient-2 {
            display: flex;
            flex-direction: row;

            p {
              width: 50%;
              overflow: hidden;
              font-size: 78px;
              @include singleEllipsis(50%);

              &:last-child {
                padding-left: 10px;
              }
            }
          }

          p {
            white-space: nowrap;
            color: rgba(229, 134, 2, 1);
          }
        }

        .wait-patient2 {
          height: 160px;
          min-height: inherit;

          p {
            line-height: 187px !important;
            font-size: 120px !important;
          }
        }

        .wait-patient3 {
          height: 160px;
          min-height: inherit;

          p {
            line-height: 147px !important;
            font-size: 100px !important;
          }
        }

        .wait-patient4 {
          height: 160px;
          min-height: inherit;

          .content {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;

            p {
              flex-basis: 50%;
              font-size: 80px;
              text-align: center;
              line-height: 147px !important;
              @include singleEllipsis(100%)
            }
          }


        }

        .wait-patient5 {
          height: 160px;
          min-height: inherit;

          .content {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;

            p {
              flex-basis: 50%;
              font-size: 70px;
              line-height: 147px !important;
            }
          }
        }

        .wait-patient6 {
          height: 160px;
          min-height: inherit;

          .content {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;

            p {
              flex-basis: 50%;
              font-size: 70px;
              line-height: 147px !important;
            }
          }
        }

        //隐藏等待患者情况下--就诊患者的样式
        .hide-waiting-patient {
          height: auto;
          min-height: inherit;
          overflow: hidden;
          flex-direction: column;

          .title {
            width: 100% !important;
            height: 222px;
            font-size: 80px;
            justify-content: center;
          }

          .content {
            width: 100% !important;
            max-height: inherit;
            justify-content: center;

            p {
              padding-left: 0;
              font-size: 124px;
              line-height: 464px;
              text-align: center;
            }
          }
        }
      }


      .pass-patient-area {
        display: flex;
        overflow: hidden;
        border-radius: 20px;
        background: rgba(255, 255, 255, 1);
        height: 160px;

        min-width: auto;

        .title {
          color: white;
          align-items: center;
          align-self: center;
          text-align: center;
          height: 100%;
          line-height: 1.15;
          padding: 0 30px;
          flex: inherit;
          display: flex;
          width: 124px !important;
          font-size: 52px;
          box-sizing: border-box;
          flex-shrink: 0;
          background: rgba(0, 0, 0, 0.3);;
        }

        .scroll {
          min-width: 100%;
          display: flex;
          flex-direction: column;
          align-self: center;
        }

        .content {
          display: flex;
          flex-direction: column;
          align-self: center;
          align-items: center;
          justify-content: left;
          flex-shrink: 0;
          background: transparent;
          border: none;
          overflow: hidden;
          box-sizing: border-box;
          width: calc(100% - 124px) !important;

          p {
            font-size: 126px;
            width: 100%;
            line-height: 176px;
            text-align: left;
            padding-left: 60px;
          }

        }

        .pass-patient {
          display: flex;
          overflow: hidden;
          flex-direction: row;
          flex-wrap: wrap;
          width: 100%;
          align-self: flex-start;

          div {
            flex-basis: calc(100% / 3);
            min-width: calc(100% / 3);
            font-size: 46px;
            flex-shrink: 0;
            line-height: 1.5;
            box-sizing: border-box;
            justify-content: center;
            align-items: start;
            text-align: center;
          }
        }
      }
    }

    .code-area {
      display: flex;
      margin-top: 30px;
      height: 314px;
      flex-direction: row;

      .item {
        background: white;
        margin: 0 20px;
        flex: 1;
        border-radius: 12px;
        overflow: hidden;
        padding: 30px 40px 16px 40px;
        box-sizing: border-box;

        &:first-child {
          margin-left: 0;
        }

        &:last-child {
          margin-right: 0;
        }

        .picture {
          height: 220px;
          overflow: hidden;

          img {
            width: 100%;
            height: 100%;
            object-fit: contain;
          }
        }

        .describe {
          width: 100%;
          font-size: 34px;
          margin-top: 18px;
          box-sizing: border-box;
          text-align: center;
          white-space: nowrap;
        }
      }
    }
  }
}
</style>
